<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>系统控制台</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <%@include file="/comm/pub.inc" %>
    <style type="text/css">
	    html, body{
	        margin:0;padding:0;border:0;width:100%;height:100%;overflow:hidden;
	    }
	    .header
	    {
	        background:url(<%=contextPath%>/images/header.gif) repeat-x;
	    }
	    .header div
	    {
	        font-family:'Trebuchet MS',Arial,sans-serif;
	        font-size:25px;line-height:60px;padding-left:10px;font-weight:bold;color:#333;        
	    }    
	    body .header .topNav
	    {
	        position:absolute;right:8px;top:10px;        
	        font-size:12px;
	        line-height:25px;
	    }
	    .header .topNav a
	    {
	        text-decoration:none;
	        color:#222;
	        font-weight:normal;
	        font-size:12px;
	        line-height:25px;
	        margin-left:3px;
	        margin-right:3px;
	    }
	    .header .topNav a:hover
	    {
	        text-decoration:underline;
	        color:Blue;
	    }   
	     .mini-layout-region-south img
	    {
	        vertical-align:top;
	    }
    </style>   
</head>
<body >   
	<div class="mini-layout" style="width:100%;height:100%;">
		<div title="north" region="north" class="header" bodyStyle="overflow:hidden;" height="80" showHeader="false" showSplit="false">
	        <div>xxxx系统-图片</div>
	        <div class="topNav">    
	            <a> 欢迎<span>某某</span>进入xxxx系统</a>&nbsp;|&nbsp;
	            <a href="<%=contextPath %>/action/system/user/loginOut" >退出系统</a>
	        </div>
	        <div style="position:absolute;right:12px;bottom:5px;font-size:12px;line-height:25px;font-weight:normal;">
	            <span style="color:Red;font-family:Tahoma">（推荐Blue）</span>选择皮肤：
	            <select id="selectSkin" onchange="onSkinChange(this.value)" style="width:100px;" >
	                <option value="">Default</option>
	                <option value="blue">Blue</option>
	                <option value="gray">Gray</option>
	                <option value="olive2003">Olive2003</option>
	                <option value="blue2003">Blue2003</option>
	                <option value="blue2010">Blue2010</option>
	            </select>
	        </div>
	    </div>
	    
	    <div region="west" title="系统菜单" showHeader="false" bodyStyle="padding-left:1px;" showSplitIcon="true" width="180" minWidth="100" maxWidth="350">
	    	<div id="menu_list" class="mini-outlookmenu" url="<%=contextPath%>/action/system/menu/getUserMenus"
			  	onitemclick="menuClick" idField="id" parentField="parentId" iconField="iconStyle"
			  	textField="name" borderStyle="border:0" >
			</div>
	    </div>
	    
	    <div title="center" region="center" style="border:0;">
	        <div id="mainTabs" class="mini-tabs" activeIndex="0" style="width:100%;height:100%;" 
	            onactivechanged="onTabsActiveChanged" oncloseclick="closeTabListener"  >
	        </div>        
	    </div>
    
	</div>
</body>
<script type="text/javascript">
var arryTabs = [];
function onSkinChange(skin) {
    mini.Cookie.set('miniuiSkin', skin);
    window.location.reload()
}
function newTabCard(id,name,url){
	var _index = getTabCardById(id),
		tabs = mini.get("mainTabs");
	if (_index != -1){
		if (url.indexOf('?') != -1)
			tabs.loadTab(contextPath+url+"&sdf="+(new Date()).getTime(),_index);
		else
			tabs.loadTab(contextPath+url+"?sdf="+(new Date()).getTime(),_index);
		tabs.activeTab(_index);
		return;
	}

	var card = { title: name, url: contextPath+url, showCloseButton: true ,menuId:id };
	tabs.addTab(card);
	arryTabs.push(id);
	tabs.activeTab(arryTabs.length-1);
}
function getTabCardById(id){
	for (var i=0;i<arryTabs.length;i++){
		var _id = arryTabs[i];
		if (id == _id){
			return i;
		}
	}
	return -1;
}
function removeTabCard(i){
	var tempAry = [];
	for(var r=0;r<arryTabs.length;r++){
		if (r == i)
			continue;
		tempAry.push(arryTabs[r]);
	}
	arryTabs = tempAry;
}
function existsTabs(id){
	return getTabCardById(id) != -1;
}

function closeTabListener(e){
	removeTabCard(e.index);
}

function menuClick(e){
	var item = e.item,
		url = item.url,
		name = item.name,
		id = item.id;
	newTabCard(id,name,url);
}
function onTabsActiveChanged(){
	
}
</script>
</html>